package com.hsd.znsh.service;


import com.hsd.znsh.utils.RsaDsaEcUtil;
import org.apache.commons.codec.binary.Base64;
import org.springframework.stereotype.Service;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.security.*;
import java.security.spec.X509EncodedKeySpec;

/*
 * @auther: wangjiacai
 *
 * @create: 2018-06-25 15:07:02
 */
@Service
public class FogIdService {

    private static String publicKey="MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAERXH7SC7qmdEpzRlwW+XBVo8jNWn+gZVMu83IxYmv5IDdYsoInVSmJUcEsyHaNzpdbBmrRAEiBSBZp4WgOaS4IA==";

    public boolean verify(String content,String sign){
        try {
            return RsaDsaEcUtil.verify("EC","SHA256withECDSA",publicKey,
                    content,sign);
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }


}

